package com.monster.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.monster.pojo.CheckGroup;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface CheckGroupMapper extends BaseMapper<CheckGroup> {
    //添加
    @Insert("insert into t_checkgroup_checkitem values (#{gid},#{cid})")
    Boolean addCheckgroupCheckitem(@Param("gid") Integer gid, @Param("cid")Integer cid);

    //中间表t_checkgroup_checkitem删除
    @Delete("DELETE FROM t_checkgroup_checkitem WHERE CHECKGROUP_ID = #{groupDTOId}")
    Boolean deleteCheckgroupCheckitem (@Param("groupDTOId") Integer groupDTOId);

    //中间表t_checkgroup_checkitem查询
    @Select("SELECT CHECKITEM_ID FROM t_checkgroup_checkitem where CHECKGROUP_ID = #{id}")
    List<Integer> findcheckitems(@Param("id") int id);
}
